package com.hbpu.maven.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {


    @RequestMapping(value = "/hello", method = RequestMethod.DELETE)
    public String sayHello() {
        return "Hello World!";
    }


    @RequestMapping(value = "/test01", params = {"age=18", "username"})
    public String test01() {
        return "test01";
    }


    @RequestMapping(value = "/test02", headers = "test02")
    public String test02() {
        return "test02";
    }

    @RequestMapping(value = "/test03", consumes = "application/json")
    public String test03() {
        return "test03";
    }

    @RequestMapping(value = "/test04", produces = "text/html")
    public String test04() {
        return "<h1>test04</h1>";
    }
}
